package TI;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import org.joda.time.DateTime;
import org.junit.Test;

import Products.Presentation;

import static org.mockito.Mockito.*;
import junit.framework.TestCase;

public class QuickSaleTest extends TestCase {

	@SuppressWarnings("unchecked")
	List<Presentation> products = mock(ArrayList.class);
	Presentation presentation = mock(Presentation.class);
	AnonymusCustomer customer = mock(AnonymusCustomer.class);
	BranchOffice branch = mock(BranchOffice.class);
	QuickSale saleToTest = new QuickSale(products, branch, customer);
	
	
	@Test
	public void testGivenAQuickSaleCreatedNowWhenGetDateShouldReturnDateToday(){
		@SuppressWarnings("deprecation")
		Date today = DateTime.now().toDateMidnight().toDate();
		assertEquals(today, saleToTest.getDate());
	}
	
	
	@Test
	public void testGivenAQuickSaleWhenGetProductsShouldReturnProducts(){
		assertEquals(products, saleToTest.getProducts());
	}

	
}
